r=4.75

r=r-4

r=1/r

r=r-1

r=1/r

r=r-3

r=1/r

ContFracNumList[realnum_?NumericQ, n_Integer?NonNegative] :=
    Module[{lst = {}, r = realnum, intpart},
        Do[ intpart = Floor[r];
                 AppendTo[lst, intpart];
                  r = r - intpart;
                  If[ r == 0, Break[] ];
                  r = 1/r, {n}];
        lst]

ContFracValue[lst_List] := Fold[ 1/#1 + #2&, Infinity, Reverse[lst] ]

ContFracNumList[4.75, 5]

ContFracNumList[N[Pi], 10]

ContFracValue[%]

%//N

ContFracNumList1[x_Real, n_Integer?Positive] :=
	Module[{intpart, fracpart=x, result={}},
		 Do[intpart = Floor[fracpart];
			     AppendTo[result, intpart];
			     fracpart = (1/(fracpart-intpart)),{n}];
		result]

l1=ContFracNumList1[N[Pi],10]

ContFracValue1[lst_List] :=
	  Fold[(#2+(1/(#1))&), 
			          First[Reverse[lst]], Rest[Reverse[lst]] ]

ContFracValue1[{a, b, c, d}]

ContFracValue1[l1]//N

ContFracValue2D[x_Real, n_Integer?Positive]:=
 ContFracValue1[
   Map[ToString, ContFracNumList1[x,n]]]

PiCFs=ContFracValue2D[N[Pi],10]

ContFracNumList1[N[Sqrt[2Pi]],10]

SR2PiCFs=ContFracValue2D[N[Sqrt[2Pi]],10]

FullForm[SR2PiCFs]

SR2PiCFs//N

ContFrac2DToValue[cfs_]:=MapAt[ToExpression, cfs, 
      Position[cfs, _String]]

ContFrac2DToValue[SR2PiCFs]

{N[%, 10], N[Sqrt[2Pi], 10]}